package com.zlq.cn.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 短信记录
 * </p>
 *
 * @author zhoucl
 * @since 2020-08-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("z_sms_record")
public class SmsRecord extends Model<SmsRecord> {
    public static final String SMS_TYPE_LOGIN = "001";

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 业务类型,注册001
     */
    private String type;

    /**
     * 短信内容
     */
    private String msg;

    /**
     * 目标手机号
     */
    private String mobile;

    /**
     * 发送时间
     */
    private LocalDateTime sendtime;

    /**
     * 使用时间
     */
    private LocalDateTime buildtime;

    /**
     * 短信状态 默认为值 0 未处理，1 已发送  2 已成功
     */
    private Integer status;

    /**
     * 验证码
     */
    private String vcode;

    /**
     * 验证码到期时间
     */
    private LocalDateTime endtime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
